1. Field of the Invention
The present invention relates to an apparatus and a method for controlling a memory, and a program included in a medium readable by a computer, and more particularly, to a technology for controlling the reading to, and writing from, a memory.
2. Description of the Related Art
Recently, with the progress of digital techniques, an apparatus has been developed for transmitting a large amount of digital data (e.g., dynamic image data) with a relatively low rate to a recording medium and the like by reducing the amount of data by compressing/encoding them.
As an apparatus of this kind, the most recently, a format of a digital VTR which records/reproduces the digitized video signals for a magnetic tape has been standardized, according to the HD public welfare digital VCR council.
In the digital VTR based on this standard, the input video signal is compressed/encoded by using DCT techniques, quantization, and variable-length encoding. The amount of information thereof is thereby compressed from about 125 Mbps into about 25 Mbps. Through a memory, the detection/correction codes (e.g., the Reed-Solomon iterated (product) code) for use in error detection/correction are added to the video signals which are compressed as described above, and recorded into the magnetic tape in a predetermined data format.
Furthermore, the video signals which are generated in accordance with the standard might be packetized for each data block in a predetermined unit, and transmitted to an external recording device and the like through a high speed digital interface.
However, when recording/reproducing the digital video signals which are compressed/encoded according to the digital VTR in real time, or when transmitting/receiving them from an external device (e.g., other digital VTR) in real time, usually, a memory for temporarily storing the video signals of predetermined units is required.
For example, when transmitting the digital video signals which are generated at the digital VTR in real time to an outside device through a transmission line having a speed different from that of the signals, because the digital video signal to be transmitted is matched with the transmission speed of the transmission line, on a transmission side, it is necessary to temporarily hold them in the memory. Then, the transmission side reads and outputs the digital video signals which are held in the memory one by one, per data for one packet by matching the transmission speed of the transmission line.
Also, similarly, when receiving the packets transmitted from an outside device one after another, it is necessary to temporarily hold the data of the respective packets in order to return the speed of the data of the respective packets received to the speed of the original digital video signals.
When reading the data being held in the memory per data of one packet, or when writing them into the memory per data of one packet, there exist the following problems.
For example, when the timings for reading the data per one packet from the memory have deviated, there was a case that all of the data of that packet could not be read. As a result, since the rest of data which remained in the memory is read together with the data which is to be read at the next data read time period, the data might have not the proper arrangement.
Furthermore, when the timings for writing the data per one packet from the memory have deviated, there was a case that all of the data of that packet could not be written. As a result, since a portion of the data is written together with the data which is to be written into the memory at the next data write time, that written data might have not the proper arrangement.